package com.tim.javaApi.reflect;



import java.beans.*;
import java.lang.reflect.Method;
import java.util.Arrays;

/**
 * @Description: java、spring bean操作api
 * @Version 1.0, 2021/9/25
 * @Author Tim
 */
public class BeanHandleUtil {
	
	public void introspector() throws IntrospectionException{
		BeanInfo beanInfo = Introspector.getBeanInfo(Person.Teacher.class);
		PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
		Arrays.stream(propertyDescriptors)
				.map(PropertyDescriptor::getReadMethod)
				.map(Method::getName)
				.forEach(System.out::println);
		MethodDescriptor[] methodDescriptors = beanInfo.getMethodDescriptors();


	}
	
	
}
